var lines = (function() {
  var geoCoordMap = {
    "上海": [31.2891, 121.4648],
    "东莞": [22.901, 113.8953],
    "东营": [37.5513, 118.7073],
    "中山": [22.478, 113.4229],
    "临汾": [36.1615, 111.4783],
    "临沂": [35.2936, 118.3118],
    "丹东": [40.4242, 124.541],
    "丽水": [28.1854, 119.5642],
    "乌鲁木齐": [43.5883, 87.9236],
    "佛山": [23.1097, 112.8955],
    "保定": [39.0948, 115.0488],
    "兰州": [36.3043, 103.5901],
    "包头": [41.4899, 110.3467],
    "北京": [40.2539, 116.4551],
    "北海": [21.6211, 109.314],
    "南京": [31.9208, 118.8062],
    "南宁": [23.1152, 108.479],
    "南昌": [28.6633, 116.0046],
    "南通": [32.1625, 121.1023],
    "厦门": [24.6478, 118.1689],
    "台州": [28.6688, 121.1353],
    "合肥": [32.0581, 117.29],
    "呼和浩特": [40.4901, 111.4124],
    "咸阳": [34.8706, 108.4131],
    "哈尔滨": [45.368, 127.9688],
    "唐山": [39.6826, 118.4766],
    "嘉兴": [30.6354, 120.9155],
    "大同": [39.8035, 113.7854],
    "大连": [39.4409, 122.2229],
    "天津": [39.4189, 117.4219],
    "太原": [37.9413, 112.3352],
    "威海": [37.1393, 121.9482],
    "宁波": [29.6466, 121.5967],
    "宝鸡": [34.3433, 107.1826],
    "宿迁": [33.7775, 118.5535],
    "常州": [31.5582, 119.4543],
    "广州": [23.2196, 113.5107],
    "廊坊": [39.0509, 116.521],
    "延安": [36.4252, 109.1052],
    "张家口": [40.8527, 115.1477],
    "徐州": [34.3268, 117.5208],
    "德州": [37.2107, 116.6858],
    "惠州": [23.1647, 114.6204],
    "成都": [30.7617, 103.9526],
    "扬州": [32.8162, 119.4653],
    "承德": [41.4075, 117.5757],
    "拉萨": [30.1465, 91.1865],
    "无锡": [31.5527, 120.3442],
    "日照": [35.5023, 119.2786],
    "昆明": [25.4663, 102.9199],
    "杭州": [29.8773, 119.5313],
    "枣庄": [34.8926, 117.323],
    "柳州": [24.9774, 109.3799],
    "株洲": [27.0319, 113.5327],
    "武汉": [30.6628, 114.3896],
    "汕头": [23.3405, 117.1692],
    "江门": [22.1484, 112.6318],
    "沈阳": [42.1216, 123.1238],
    "沧州": [38.2104, 116.8286],
    "河源": [23.9722, 114.917],
    "泉州": [25.1147, 118.3228],
    "泰安": [36.0516, 117.0264],
    "泰州": [32.5525, 120.0586],
    "济南": [36.8701, 117.1582],
    "济宁": [35.3375, 116.8286],
    "海口": [19.8516, 110.3893],
    "淄博": [36.6064, 118.0371],
    "淮安": [33.4039, 118.927],
    "深圳": [22.5439, 114.5435],
    "清远": [24.3292, 112.9175],
    "温州": [27.8119, 120.498],
    "渭南": [35.0299, 109.7864],
    "湖州": [30.7782, 119.8608],
    "湘潭": [27.7075, 112.5439],
    "滨州": [37.4963, 117.8174],
    "潍坊": [36.524, 119.0918],
    "烟台": [37.5128, 120.7397],
    "玉溪": [23.8898, 101.9312],
    "珠海": [22.1155, 113.7305],
    "盐城": [33.5577, 120.2234],
    "盘锦": [41.0449, 121.9482],
    "石家庄": [38.1006, 114.4995],
    "福州": [25.9222, 119.4543],
    "秦皇岛": [40.0232, 119.2126],
    "绍兴": [29.7565, 120.564],
    "聊城": [36.4032, 115.9167],
    "肇庆": [23.5822, 112.1265],
    "舟山": [30.2234, 122.2559],
    "苏州": [31.3989, 120.6519],
    "莱芜": [36.2714, 117.6526],
    "菏泽": [35.2057, 115.6201],
    "营口": [40.4297, 122.4316],
    "葫芦岛": [40.578, 120.1575],
    "衡水": [37.7161, 115.8838],
    "衢州": [28.8666, 118.6853],
    "西宁": [36.8207, 101.4038],
    "西安": [34.2004, 109.1162],
    "贵阳": [26.7682, 106.6992],
    "连云港": [34.552, 119.1248],
    "邢台": [37.2821, 114.8071],
    "邯郸": [36.535, 114.4775],
    "郑州": [34.6234, 113.4668],
    "鄂尔多斯": [39.2487, 108.9734],
    "重庆": [30.1904, 107.7539],
    "金华": [29.1028, 120.0037],
    "铜川": [35.1947, 109.0393],
    "银川": [38.1775, 106.3586],
    "镇江": [31.9702, 119.4763],
    "长春": [44.2584, 125.8154],
    "长沙": [28.2568, 113.0823],
    "长治": [36.4746, 112.8625],
    "阳泉": [38.0951, 113.4778],
    "青岛": [36.3373, 120.4651],
    "韶关": [24.7028, 113.7964]
  }

  var BJData = [
    [{ name: "成都" }, { name: "潍坊", value: 5 }],
    [{ name: "潍坊" }, { name: "西宁", value: 5 }],
    [{ name: "西宁" }, { name: "温州", value: 5 }],
    [{ name: "温州" }, { name: "东莞", value: 5 }],
    [{ name: "东莞" }, { name: "汕头", value: 5 }],
    [{ name: "汕头" }, { name: "福州", value: 5 }],
    [{ name: "福州" }, { name: "连云港", value: 5 }],
    [{ name: "连云港" }, { name: "长春", value: 5 }],
    [{ name: "长春" }, { name: "南昌", value: 5 }],
    [{ name: "南昌" }, { name: "咸阳", value: 5 }],
    [{ name: "咸阳" }, { name: "廊坊", value: 5 }],
    [{ name: "廊坊" }, { name: "沈阳", value: 5 }],
    [{ name: "沈阳" }, { name: "西安", value: 5 }],
    [{ name: "西安" }, { name: "南京", value: 5 }],
    [{ name: "南京" }, { name: "连云港", value: 5 }],
    [{ name: "连云港" }, { name: "深圳", value: 5 }],
    [{ name: "深圳" }, { name: "泰安", value: 5 }],
    [{ name: "泰安" }, { name: "武汉", value: 5 }],
    [{ name: "武汉" }, { name: "昆明", value: 5 }],
    [{ name: "昆明" }, { name: "南京", value: 5 }],
    [{ name: "南京" }, { name: "武汉", value: 5 }],
    [{ name: "武汉" }, { name: "烟台", value: 5 }],
    [{ name: "烟台" }, { name: "长春", value: 5 }],
    [{ name: "长春" }, { name: "贵阳", value: 5 }],
    [{ name: "贵阳" }, { name: "宿迁", value: 5 }],
    [{ name: "宿迁" }, { name: "徐州", value: 5 }],
    [{ name: "徐州" }, { name: "丽水", value: 5 }],
    [{ name: "丽水" }, { name: "长沙", value: 5 }],
    [{ name: "长沙" }, { name: "沧州", value: 5 }],
    [{ name: "沧州" }, { name: "盐城", value: 5 }],
    [{ name: "盐城" }, { name: "宁波", value: 5 }],
    [{ name: "宁波" }, { name: "宁波", value: 5 }],
    [{ name: "宁波" }, { name: "泰安", value: 5 }],
    [{ name: "泰安" }, { name: "厦门", value: 5 }],
    [{ name: "厦门" }, { name: "保定", value: 5 }],
    [{ name: "保定" }, { name: "宿迁", value: 5 }],
    [{ name: "宿迁" }, { name: "深圳", value: 5 }],
    [{ name: "深圳" }, { name: "贵阳", value: 5 }],
    [{ name: "贵阳" }, { name: "金华", value: 5 }],
    [{ name: "金华" }, { name: "肇庆", value: 5 }],
    [{ name: "肇庆" }, { name: "金华", value: 5 }],
    [{ name: "金华" }, { name: "苏州", value: 5 }],
    [{ name: "苏州" }, { name: "东莞", value: 5 }],
    [{ name: "东莞" }, { name: "惠州", value: 5 }],
    [{ name: "惠州" }, { name: "邯郸", value: 5 }],
    [{ name: "邯郸" }, { name: "玉溪", value: 5 }],
    [{ name: "玉溪" }, { name: "中山", value: 5 }],
    [{ name: "中山" }, { name: "乌鲁木齐", value: 5 }],
    [{ name: "乌鲁木齐" }, { name: "廊坊", value: 5 }],
    [{ name: "廊坊" }, { name: "廊坊", value: 5 }]
  ];

  var convertData = function(data) {
    var res = [];
    for (var i = 0; i < data.length; i++) {
      var dataItem = data[i];
      var fromCoord = geoCoordMap[dataItem[0].name];
      var toCoord = geoCoordMap[dataItem[1].name];
      if (fromCoord && toCoord) {
        res.push({
          fromName: dataItem[0].name,
          toName: dataItem[1].name,
          coords: [fromCoord, toCoord],
          value: dataItem[1].value
        });
      }
    }
    return res;
  };

  return convertData(BJData);
})();
